/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * <p>Project: jse2303 - Stream3</p>
 * <p>Powered by webrx On 2023-07-25 15:39:08</p>
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream6 {
    public static void main(String[] args) {
        //System.out.println(1 * 2 * 3 * 4 * 5 * 6);
        //int reduce = IntStream.rangeClosed(1, 6).reduce(1, (a, b) -> a * b);
        //System.out.println(reduce);

        //IntStream.rangeClosed(1,100).sum();

        //Stream<Integer> ss = Stream.iterate(1, a -> a + 1).limit(100);
        //System.out.println(ss.reduce(0, (a, b) -> a + b));
        //System.out.println(ss.reduce(1, (a, b) -> a * b));
        //ss.forEach(System.out::println);

        //流转换List集合
        List<Integer> list = Stream.of(1, 2, 3).toList();

        String str = Stream.of("java", "php", "python").collect(Collectors.joining("-"));
        System.out.println(str);

    }
}
